﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;

namespace AnTeWei
{
    public partial class test : System.Web.UI.Page
    {
        Contact ct = new Contact();
        DataControl.DataAccess da = new DataControl.DataAccess();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }
        private void BindData()
        {
            try
            {
                StringBuilder sql = new StringBuilder();
                sql.Append(@"select * from T_Contract");
                DataTable dt = da.PageSize(sql.ToString(), 1, 20, "id");
                rpList.DataSource = dt;
                rpList.DataBind();
            }
            catch (Exception ex)
            {

            }
        }
        protected void lbnPrev_Click(object sender, EventArgs e)
        {
            LinkButton lbn = (LinkButton)sender;
            string contartid = lbn.CommandArgument;
            StringBuilder sql = new StringBuilder();
            sql.Append(@"select content from T_Contract where ContractID='" + contartid + "'");
            object o = da.ExecuteScalar(sql.ToString());
            string content = o.ToString();
            Response.Clear();
            Response.Write(content);
            Response.End();
        }
        protected void lbnC_Click(object sender, EventArgs e)
        {
            Contact ct = new Contact();
            ct.GenerateSupplyContact("", "E:/Projects/安特威/AnTeWei/CommonFile/ContactDemo/Supply/SupplyContact.html");
        }
    }
}